import React from 'react'
// ===================================================================== Temp
import Table from '#cpt/temp/Table'
import SearchForm from '#cpt/temp/SearchForm'
// ===================================================================== global declare
const { $fn, $Lazy } = window
// ===================================================================== Lazy
const $time = $Lazy.file(()=>import('@com/utils/time'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		data: [],
		forms : [
			{ label: '操作时间',	 names: ['start_at','end_at'], name:'jz-time', type:'date-range' },
		]
	}
	
	componentDidMount(){
		// 设置时间默认值
		$time.then(f=>{
			const arr = f.duration['1-9-9']()
			this.resetModel = { start_at: arr[0], end_at: arr[1], 'jz-time':arr }
			this.model = $fn.copy(this.resetModel)
			this.fetch()
		})
	}
	
	// paging
	fetch = () => $fn.fetch.call(this,'specimen/employeeEntryStatistics', { paging: 'get', isIndex:true})
	
	// 表单
	cols = [
		{ title: '医院名称',			dataIndex: 'hosp_name'},
		{ title: '条码数量', 		dataIndex: 'count' },
		{ title: '操作人', 			dataIndex: 'real_name' }
	]
	
	render(){
		return (
			<div className='bcf mt5'>
				{/* 搜索 */}
				{ SearchForm.call(this, { timeStr:'1-9-9' }) }
				{/* 表格 */}
				{ Table.call(this, { wrapStyle:{height:350}, isIndex:true }) }
			</div>
		)
	}
}

export default Index